/**
 * 显示成功提示框
 */
export const showSuccess = (msg: string, callback?: Function) => {
    uni.showToast({
      title: msg,
      icon: 'success',
      mask: true,
      duration: 1500,
      success() {
        callback && callback()
      }
    })
}


/**
 * 显示失败提示框
 */
export const showError = (msg: string, callback?: Function) => {
    uni.showModal({
      title: '错误提示',
      content: msg,
      showCancel: false,
      success(res) {
        callback && callback()
      }
    })
}

/**
 * 显示失败提示框
 */
export const showModal = (title: string, msg: string, callback?: Function) => {
  uni.showModal({
    title: title,
    content: msg,
    showCancel: false,
    success(res) {
      callback && callback()
    }
  })
}

/**
 * 显示纯文字提示框
 */
export const showToast = (msg: string, duration: number = 3000, mask:boolean = true) => {
    uni.showToast({
      title: msg, // 提示的内容
      icon: 'none',
      mask, // 是否显示透明蒙层，防止触摸穿透 (支付宝小程序不支持)
      duration // 提示的延迟时间，单位毫秒，默认：1500	
    })
}